#ifndef LIBKYREALTIMEINFO_H
#define LIBKYREALTIMEINFO_H

#define REAL_TIME_EXPORT     __attribute__((visibility("default")))

namespace KDK_SYSTEM {
    struct if_data
    {
        /*  generic interface information */
        unsigned int ifi_opackets; /*  packets sent on interface */
        unsigned int ifi_ipackets; /*  packets received on interface */
        unsigned int ifi_obytes;   /*  total number of octets sent */
        unsigned int ifi_ibytes;   /*  total number of octets received */
    };

    struct if_info
    {
        char ifi_name[16];
        unsigned long ifi_ibytes;
        unsigned long ifi_obytes;
    };
    struct if_speed
    {
        char ifs_name[16];
        unsigned long ifs_ispeed;
        unsigned long ifs_ospeed;
        unsigned long ifs_us;
    };
}

class REAL_TIME_EXPORT RealTimeInfo
{
public:
    RealTimeInfo();
public:
    float kdk_real_get_io_speed();
    float kdk_real_get_net_speed(const char *nc);
    float kdk_real_get_cpu_temperature();
    float kdk_real_get_disk_temperature(const char *name);
    int kdk_real_get_disk_rate(const char *name);
private:
    int get_if_dbytes(struct KDK_SYSTEM::if_info *ndev);
    int get_if_speed(struct KDK_SYSTEM::if_speed *ndev);
};

#endif // LIBKYREALTIMEINFO_H
